package com.zsh.spring.service;

import com.zsh.spring.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.event.TransactionalEventListener;

@Service
@Transactional //可以加类或者方法上面
public class UserService {

    @Autowired
    private UserDao userDao;


    public void accountMoney(){

//        try {

            userDao.reduceMoney();
//            int i = 10/0;
            userDao.addMoney();
        /*} catch (Exception e) {
            e.printStackTrace();
        }*/

    }
}
